/**
 * @fileOverview
 * @name model/biz.js
 * @author hudingyu <hudingyu@meituan.com>
 * @date 2018/7/22
 * @license MIT
 */
require('./dbInit');
const mongoose = require('mongoose');
mongoose.Promise = global.Promise;

const projectModel = {
    projId: Number,
    bizName: String,
    bizId: Number,
    feCode: String,
    beCode: String,
    projName: String,
};

let schema = mongoose.Schema;
let projectMap = new schema(projectModel);
// projectMap.plugin(mongoosePaginate);
let projectDbModel = mongoose.model('Project', projectMap);
projectDbModel.collection.createIndex({projId:1}, {unique:true, dropDups:true});

module.exports = { projectModel, projectDbModel };